package com.douma.dao.impl;

import com.douma.dao.CommentDao;
import com.douma.dto.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * 抖码课堂，专注中国程序员基础内功修炼
 * 官网：douma-tech.com
 * 公众号：抖码课堂
 *
 * @作者 : 老汤
 */

@Repository
public class CommentDaoImpl implements CommentDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void insert(Comment comment) {
        String sql = "INSERT INTO t_comment VALUES(NULL, ?, ?, now())";
        jdbcTemplate.update(sql, comment.getShopId(), comment.getContent());
    }
}
